from flask import Flask

from flask_cors import *

from flask_mongoengine import MongoEngine

db = MongoEngine()

def create_app():
    app = Flask(__name__)

    app.config.from_object('config')

    db.init_app(app)

    #蓝图注册
    from app.vueapi import vueapi as api_blueprint
    app.register_blueprint(api_blueprint, url_prfix="/vueapi")

    CORS(app, supports_credentials=True)
    return app